<?php
/**
 * new develop: 设置消息接收的对象信息send_group
 * 'key'=>[//key是对象的键
 *      '对象类型名称'=>[
 *          'name'=>'对象名'，
 *          'model'=>'对应的模型',
 *          'key'=>'对象模型在其他模型表中的外键字段',//比如订单需要关联下单的用户，这个就是订单中关联到用户表的外键字段值
 *          'mobile_key'=>'对象模型对应手机号的字段名',
 *          'email_key'=>'对象模型对应邮箱的字段名',
 *          'wechat_key'=>'对象模型对应微信openid的字段名',
 *      ]
 * ]
 */
return [
    'receive_group'=>[
        'customer'=>[
            'name'=>'客户',
            'model'=>'common\models\datas\Customer',
            'key'=>'customer_id',
            'mobile_key'=>'mobile',
            'email_key'=>'email',
            'primary_key'=>'id'
        ],
        'student'=>[
            'name'=>'学生',
            'model'=>'common\models\datas\Student',
            'key'=>'student_id',
            'type'=>'hide'
        ],
        'class_student'=>[
            'name'=>'课程学生',
            'model'=>'zhtfrontend\models\datas\ClassStudent',
            'key'=>'class_student_id',
            'type'=>'hide',
        ],
        'teacheradmin'=>[
            'name'=>'教师管理',
            'model'=>'zhtfrontend\models\datas\Admin',
            'key'=>'admin_id',
            'type'=>'hide',
        ],
        'teacher'=>[
            'name'=>'教师',
            'model'=>'zhtfrontend\models\datas\Teacher',
            'key'=>'teacher_id',
            'mobile_key'=>'mobile',
            'email_key'=>'email',
        ],
        'admin'=>[
            'name'=>'管理员',
            'model'=>'zhtfrontend\models\datas\Admin',
            'key'=>'user_id',
            'email_key'=>'email'
        ],
        'class_teacher'=>[
            'name'=>'班主任',
            'model'=>'zhtfrontend\models\datas\Admin',
            'key'=>'admin_id'
        ],
        'mechanic'=>[
            'name'=>'机构',
            'model'=>'zhtfrontend\models\datas\Mechanic',
            'key'=>'mechanic_id',
            'mobile_key'=>'telephone'
        ],
        'onlysms'=>[//单独的发送短信没有其他的东西
            'name'=>'仅发送短信',
            'key'=>'telephone'
        ],
        /*类型是class的都是为了班级服务的不需要额外的显示在非班级的列表中,hide的是为了提供服务的不属于可选的范围的*/
        'goods'=>[
            'name'=>'商品',
            'model'=>'zhtfrontend\models\datas\Goods',
            'key'=>'associate_id',
            'type'=>'hide'
        ],
        'arrangement'=>[
            'name'=>'排课',
            'model'=>'zhtfrontend\models\datas\Arrangement',
            'key'=>'arrangement_id',
            'type'=>'hide'
        ],
        //群发还跨个数据库这么蛋疼怎么统一呵呵呵
        'class_student:class_manage_id->student->customer'=>[
            'name'=>'班级名下会员(们)',
            'type'=>'class',//与班级相关的
            'for'=>'group'//为群发而生的
        ],
        'goods->arrangement->teacher'=>[
            'name'=>'班级教师',
            'type'=>'class',
        ],
        'orderitem_goods'=>[
            'name'=>'商品',
            'model'=>'zhtfrontend\models\datas\Goods',
            'key'=>'goods_id',
            'type'=>'hide'
        ],
        'orderitem_goods->mechanic'=>[
            'name' => '商品机构',
        ],
        //家长预约相关的模型的关联
        'goods_teacher'=>[
            'name'=>'商品教师',
            'model'=>'zhtfrontend\models\datas\GoodsTeacher',
            'key'=>'goods_id',
            'primary_key'=>'goods_id',
            'type'=>'hide'
        ],
        'goods_teacher->teacher'=>[
            'name'=>'商品教师'
        ],
        'orders'=>[
            'name'=>'订单',
            'model'=>'zhtfrontend\models\datas\Orders',
            'key'=>'orders_id',
            'primary_key'=>'id',
            'type'=>'hide'
        ],
        'orders->customer'=>[
            'name'=>'订单会员'
        ],
        //针对请假的
        'student->customer'=>[
            'name'=>'学生家长'
        ],
        //请假对应的老师，好多表才能链接到老师上
        'class_lesson'=>[
            'name'=>'课程课次',
            'model'=>'zhtfrontend\models\datas\ClassLesson',
            'key'=>'class_lesson_id',
            'primary_key'=>'lesson_id',
            'type'=>'hide'
        ],
        'class_manage'=>[
            'name'=>'课程管理',
            'model'=>'zhtfrontend\models\datas\ClassManage',
            'key'=>'class_id',
            'primary_key'=>'class_id',
            'type'=>'hide'
        ],
        'old_class_manage'=>[
            'name'=>'旧课程管理',
            'model'=>'zhtfrontend\models\datas\ClassManage',
            'key'=>'old_class_manage_id',
            'primary_key'=>'class_id',
            'type'=>'hide'
        ],
        'class_lesson->class_manage->goods->arrangement->teacher'=>[
            'name'=>'课次课程关联的老师',
        ],
        //老师请假给所有名下的学生家长发送消息，这个家长怎么获取
        'class_manage->class_student:class_manage_id->student->customer'=>[
            'name'=>'课程名下家长们',
            'for'=>'group'//为群发而生的
        ],
        'class_manage->goods->arrangement->teacher'=>[
            'name'=>'课程老师',
        ],
        //转班
        'old_class_manage->goods->arrangement->teacher'=>[
            'name'=>'班级老师',
        ],
        //未打卡
        'student_check'=>[
            'name'=>'学生未打卡',
            'model'=>'zhtfrontend\models\datas\StudentCheck',
            'key'=>'studentcheck_id',
            'primary_key'=>'id',
            'conditions'=>['status'=>0],//按照where语句的形式编写数组
            'type'=>'hide'
        ],
        'student_check:class_lesson_id->student->customer'=>[
            'name'=>'未打卡提醒家长',
        ],
    ],
];